/******************************************************************************
	This file is a part of the Snapshot Bioinformatics Project

	Copyright (C) 2012-2013 Jarom Schow

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef SQL_INSERT_BUILDER_H
#define SQL_INSERT_BUILDER_H

#include "BioDefs.h"

#include <QtCore/QStringList>

namespace Bio {

class SqlServer;

class BIO_EXPORT SqlInsertBuilder {
public:
	SqlInsertBuilder( const QString &sql, SqlServer *db );
	virtual ~SqlInsertBuilder();

	bool	addValue( int val );
	bool	addValue( const QString &val );
	bool	addNullValue();
	bool	addRow();
	bool	addRow( const QString &values );

	bool	flush();

private:

	int				m_querySize;
	QString			m_sql;
	QStringList		m_rows, m_values;
	SqlServer		*m_server;
};

}; // Bio

#endif // SQL_INSERT_BUILDER_H